﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel.Description;
using System.ServiceModel.Dispatcher;
using System.ServiceModel;

namespace suanpan.API.Components.Behaviors.ContractBehaviors
{
    //[AttributeUsageAttribute(AttributeTargets.Interface)]
    //public sealed class RestChessContextAttribute : Attribute, IContractBehavior, IInstanceContextInitializer
    //{

    //    #region IContractBehavior Members

    //    public void AddBindingParameters(ContractDescription contractDescription, ServiceEndpoint endpoint, System.ServiceModel.Channels.BindingParameterCollection bindingParameters)
    //    {
    //    }

    //    public void ApplyClientBehavior(ContractDescription contractDescription, ServiceEndpoint endpoint, System.ServiceModel.Dispatcher.ClientRuntime clientRuntime)
    //    {
    //    }

    //    public void ApplyDispatchBehavior(ContractDescription contractDescription, ServiceEndpoint endpoint, System.ServiceModel.Dispatcher.DispatchRuntime dispatchRuntime)
    //    {
    //        dispatchRuntime.InstanceContextInitializers.Add(this);
    //    }

    //    public void Validate(ContractDescription contractDescription, ServiceEndpoint endpoint)
    //    {
    //    }

    //    #endregion

    //    #region IInstanceContextInitializer Members

    //    public void Initialize(InstanceContext instanceContext, System.ServiceModel.Channels.Message message)
    //    {
    //        instanceContext.Extensions.Add(new MySpaceContextExtension());
    //    }

    //    #endregion
    //}
}
